package Exception3;

public class InvalidAgeException extends Exception{
    private int invalidAge;

    public int getInvalidAge() {
        return invalidAge;
    }

    public InvalidAgeException(int invalidAge) {
        super("InvalidAgeException: Invalid age "+invalidAge);
        this.invalidAge = invalidAge;
    }

    @Override
    public String toString() {
        return "InvalidAgeException: Invalid age "+ invalidAge;
    }
}
